/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.buliderpattern.fatory;

import za.ac.cput.buliderpattern.model.MealOrder;

/**
 *
 * @author 208179968
 */
public class MealBuilder {
    
    public static class Builder{
        
     // choice mandatory
    private String choice;
    // optional
    private String coke;
    private String coffee;
    private String white;

        public Builder(String choice) {
            this.choice = choice;
        }
     public Builder coke(String coke)
     {
         this.coke = coke;
         return this;
     }
     
      public Builder coffee(String coffee)
     {
         this.coffee = coffee;
         return this;
     }
      public Builder white(String white)
     {
         this.white = white;
         return this;
     }
     public MealOrder build(){
         return getMealOrder(this);
     }
      
     private MealOrder getMealOrder(Builder build){
         MealOrder mealOrder = new MealOrder();
         mealOrder.setChoice(build.choice);
         mealOrder.setCoffee(build.coffee);
         mealOrder.setCoke(build.coke);
         mealOrder.setWhite(build.white);
         return mealOrder;
     }
    }
    
}
